
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "NSString+File.h"


@interface CoreArchive : NSObject

#pragma mark - 偏好类信息存储

/**
 *  保存普通字符串
 */
+ (void)setStr:(NSString *)str key:(NSString *)key;

/**
 *  读取
 */
+ (NSString *)strForKey:(NSString *)key;

/**
 *  删除
 */
+ (void)removeStrForKey:(NSString *)key;

/**
 *  保存int
 */
+ (void)setInt:(NSInteger)i key:(NSString *)key;

/**
 *  读取int
 */
+ (NSInteger)intForKey:(NSString *)key;

/**
 *  保存float
 */
+ (void)setFloat:(CGFloat)floatValue key:(NSString *)key;

/**
 *  读取float
 */
+ (CGFloat)floatForKey:(NSString *)key;

/**
 *  保存bool
 */
+ (void)setBool:(BOOL)boolValue key:(NSString *)key;

/**
 *  读取bool
 */
+ (BOOL)boolForKey:(NSString *)key;

#pragma mark - 文件归档

/**
 *  归档
 */
+ (BOOL)archiveRootObject:(id)obj toFile:(NSString *)path;

/**
 *  删除
 */
+ (BOOL)removeRootObjectWithFile:(NSString *)path;

/**
 *  解档
 */
+ (id)unarchiveObjectWithFile:(NSString *)path;

@end
